package com.xiaoma.base.string;

public class StrTest {
    public static void main(String[] args) {
        String str="hello world";
        String str1="hello world";
        /*
        String myString = new String("hello world");
        String yourString = new String("hello world");*/

//        System.out.println(str1==str);



        String str2 = "b";

        String str4 = str1 + str2;
        String str5 = new String("ab");
        String str3 = "ab";

        System.out.println(str5.equals(str3));
        System.out.println(str5 == str3);
        System.out.println(str5.intern() == str3);
        System.out.println(str5.intern() == str4);
    }
}
